﻿package com.scn.base.tags;

import java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
import org.apache.log4j.Logger;
import com.scn.base.util.MD5Util;

public class MenuViewTag extends TagSupport { 
	private static Logger  log = Logger.getLogger(MenuViewTag.class);
	/**
	 * 用户名称
	 */
	private String role;

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	/**
	 * tlist:header 标签开始
	 *
	 * @exception JspException
	 */
	public int doStartTag() throws JspException {
	  return SKIP_BODY;
	}

	/**
	 * 从session中读取错误列表
	 *
	 * @exception JspException
	 */
	public int doEndTag() throws JspException
	{
	  JspWriter writer = pageContext.getOut();
	  try
	  {
		String jsname = MD5Util.md5Encrypt(role);
		writer.print("Menu"+jsname+".js");
	  }
	  catch (IOException ioe)
	  {
		log.error(ioe.getMessage());
	  }
	  return EVAL_PAGE;
	}

}